import React, {Fragment} from 'react';
import {Link} from "react-router-dom";

import {formatMessage} from '@/utils/locale';
import GlobalFooter from '@/components/GlobalFooter';

import {Icon} from 'antd';
import styles from './UserLayout.less';
import logo from '@/assets/logo.png';

const links = [
  {
    key: 'help',
    title: formatMessage({id: 'layout.user.link.help'}),
    href: '',
  },
  {
    key: 'privacy',
    title: formatMessage({id: 'layout.user.link.privacy'}),
    href: '',
  },
  {
    key: 'terms',
    title: formatMessage({id: 'layout.user.link.terms'}),
    href: '',
  },
];

const copyright = (
  <Fragment>
    Copyright <Icon type="copyright"/>2018 高树安弗（杭州）科技有限公司版权所有
  </Fragment>
);

class UserLayout extends React.PureComponent {
  render() {
    const {children} = this.props;
    return (
      <div className={styles.container}>
        <div className={styles.lang}>
        </div>
        <div className={styles.content}>
          <div className={styles.top}>
            <div className={styles.header}>
              <Link to="/">
                <img alt="logo" className={styles.logo} src={logo}/>
                {/*<span className={styles.title}>Admin Login</span>*/}
              </Link>
            </div>
            {/*<div className={styles.desc}>A background management system</div>*/}
          </div>
          {children}
        </div>
        <GlobalFooter links={links} copyright={copyright}/>
      </div>
    );
  }
}

export default UserLayout;
